home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16903 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: in2.uu.net!novia!usenet
  2. From: srwillrd@novia.net (William E. Kempf)
  3. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++
  4. Subject: Re: Linked Lists
  5. Date: Fri, 12 Apr 1996 16:28:25 GMT
  6. Organization: Novia Internetworking <> 28.8kbps dialup; 402/390-2NET
  7. Message-ID: <316e8299.262706081@204.248.25.97>
  8. References: <4k2kom$k5r@news2.cts.com> <31667AC8.4EE2@mindlink.bc.ca> <4khrin$m41@news2.cts.com>
  9. NNTP-Posting-Host: 167.16.65.84
  10. X-Newsreader: Forte Agent .99e/32.201
  11.  
  12. tsk@cts.com (John Lutz) wrote:
  13.  
  14. :In article <31667AC8.4EE2@mindlink.bc.ca>,
  15. :   Blake Kadatz <blake_kadatz@mindlink.bc.ca> wrote:
  16. :>John Lutz wrote:
  17. :>> 
  18. :>>   I would like to store all the objects in a linked list for a given 
  19. :window. I
  20. :>> would like for the linked list to handle the dynamic allocation of these
  21. :>> object and return the pointer to the subclass that is allocating the 
  22. :objects
  23. :>> on the linked list. I would like for the linked list class to delete all
  24. :>> objects dynamically.
  25. :>
  26. :>Have you tried CObList or CPtrList?  These classes don't automatically 
  27. :>delete the object for you, but when you remove the object from the list, 
  28. :>it returns you a pointer.  Easy -- just delete that pointer.
  29. :>
  30. :
  31. :
  32. :Opps, I forgot to mention it's under Visual C++ 4.0 but not using
  33. :MFC.
  34. :
  35. :John
  36. :
  37. :PS- Also, this project doesn't include MFC, how difficult would it be to 
  38. :implemente MFC (linking in a .LIB file)? I'm somewhat new to MFC/VC++ but not 
  39. :to C++.
  40. :
  41. Linked lists are actually quite easy to implement, if you are looking
  42. to do it yourself.  Most C++ programming books will discuss how.
  43.  
  44. If you are looking for other libraries that will do it for you, check
  45. out either STL (included with VC++ 4.0) or RogueWave.
  46.  
  47. -----
  48. William E. Kempf          : http://www.novia.net/~srwillrd
  49. "Sir Willard"             : mailto:srwillrd@novia.net (home)
  50. Knight of the Ascii Table : mailto:wekempf@marlton.1dc.com (work)
  51.